﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="frm_Coordinador.aspx.cs" Inherits="ED_Nivelacion.PresentacionWeb.frm_Coordinador" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentCss" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            width: 182px;
        }
        .auto-style3 {
            width: 270px;
        }
        .auto-style4 {
            width: 272px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form runat="server">

        <script>
            function show() {
                document.write("<head id='head2' runat='server'></head>");
            }
</script>
        <script>
      $(document).on("click", ".borrar", function () {
                   
          var id = $(this).data("coordinador");

                //alert(id);
                $('#ContentPlaceHolder1_idEliminar').val(id);

            });
            $(document).on("click", ".editar", function () {

                var id = $(this).data("id");
                var nombre = $(this).data("nombre");
                var apellido = $(this).data("apellido");
                var cedula = $(this).data("cedula");
                 
                $('#ContentPlaceHolder1_txt_Editar').val(id);
                $('#ContentPlaceHolder1_txt_NombresC').val(nombre);
                $('#ContentPlaceHolder1_txt_ApellidosC').val(apellido);
                $('#ContentPlaceHolder1_txt_CCCoord').val(cedula);

                $('#ContentPlaceHolder1_btn_Editar_Coordinador').show();
                $('#ContentPlaceHolder1_Btn_Guardar_Coordinador').hide();
            });

            $(document).on("click", ".guardar", function () {
                var id = $(this).data("idcarrera");
                // 
           
                $('#ContentPlaceHolder1_Btn_Guardar_Coordinador').show();
                $('#ContentPlaceHolder1_btn_Editar_Coordinador').hide();
            });

            function limpiar() {
                
                $('#ContentPlaceHolder1_txt_Editar').val("");
                $('#ContentPlaceHolder1_txt_NombresC').val("");
                $('#ContentPlaceHolder1_txt_ApellidosC').val("");
                $('#ContentPlaceHolder1_txt_CCCoord').val("");
            }



        </script>
        <% ED_Nivelacion.Negocios.Coordinador_C _objCoordinador_C = new ED_Nivelacion.Negocios.Coordinador_C();
           ED_Nivelacion.Negocios.Periodo_C _objPeriodo_C = new ED_Nivelacion.Negocios.Periodo_C();
            %>
                <div class="col-lg-22">
                                            <asp:ScriptManager ID="ScriptManager1" runat="server">
                                </asp:ScriptManager>
&nbsp;<asp:Timer ID="Timer1" runat="server">
                                </asp:Timer>
                                                 
                                                <div class="portlet portlet-default">
                            <div class="portlet-heading">
                                <div class="portlet-title">
                                    <h4>Coordinador</h4>

                                </div>
                                <div class="clearfix">
                                    <div class ="portlet-widgets"> 
                                        <a class ="btn btn-success btn-xs guardar" data-toggle ="modal" data-target ="#AgregarCoordinador" onclick="limpiar()"> <i class ="fa fa-plus"> Agregar </i> </a>   
                                    </div>
                                </div>
                            </div>
                            <div class="portlet-body">
                                <div class="table-responsive"> 
                                    
                                    <table id="example-table" class="table table-striped table-bordered table-hover table-green">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th class="auto-style4">NOMBRE</th>
                                                <th class="auto-style3">APELLIDO</th>
                                                <th>CÉDULA O PASAPORTE</th>
                                                <th>ACCIÓN</th>
                                            </tr>
                                        </thead>
                                        <%
                                            foreach (var item in _objCoordinador_C.ObtenerCoordinador())
                                            {
                                             %>
                                        <tr class="odd gradeX">
                                                        <td class="auto-style19"><%=item.idCoordinador %></td>
                                                        <td class="auto-style4"><%=item.Nombre %></td>
                                                        <td class="auto-style3"><%=item.Apellido %></td>
                                                        <td class="auto-style19"><%=item.Cedula %></td>
                                                        <td class="auto-style19"><a class ="btn btn-orange btn-sm editar" data-toggle ="modal" data-target ="#AgregarCoordinador" data-id="<%=item.idPersona%>" data-nombre="<%=item.Nombre %>" data-apellido="<%=item.Apellido %>" data-cedula="<%=item.Cedula%>"><i class ="fa fa-pencil"></i>MODIFICAR</a> &nbsp;</td>
                                                    </tr>
                                        <%} %>
                                        <asp:TextBox ID="idEliminar" runat="server" CssClass="hidden"></asp:TextBox>

                                    </table>
                                     
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.portlet-body -->
                        </div>


                                 
                        
                        <!-- /.portlet -->

                    </div>

        <div class="col-lg-22">
    <div class="modal modal-flex fade" id="AgregarCoordinador" tabindex="-1" role="dialog" aria-labelledby="flexModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                <h4 class="modal-title" id="flexModalLabel">Agregar Coordinador</h4>
                                            </div>
                                            <div id="Div1" class="modal-body" runat="server">
                                                <div class="panel panel-default">
 
                            <div class="panel-body">
                                <div class="table-responsive">


                                    <asp:TextBox ID="txt_Editar" runat="server" CssClass="hidden"></asp:TextBox>

                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                            <tr>
                                                <th class="auto-style1">Datos</th>
                                                <th>Coordinador</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td class="auto-style1">C.C. o Pasaporte:</td>
                                                <td>
                                                    <asp:TextBox ID="txt_CCCoord" required runat="server"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="auto-style1">Nombres:</td>
                                                <td>
                                                    <asp:TextBox ID="txt_NombresC" required runat="server"></asp:TextBox>
                                                    <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txt_NombresC" FilterType="LowercaseLetters,UppercaseLetters,Custom" ValidChars="ñÑáéíóúÁÉÍÓÚ " />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="auto-style1">Apellidos:</td>
                                                <td>
                                                    <asp:TextBox ID="txt_ApellidosC" required runat="server"></asp:TextBox>
                                                    <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="txt_ApellidosC" FilterType="LowercaseLetters,UppercaseLetters,Custom" ValidChars="ñÑáéíóúÁÉÍÓÚ " />
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>

                                </div>
                            </div>
                        </div>
                                            </div>
                                            <div class="modal-footer">
                                             <asp:Button ID="Btn_Guardar_Coordinador" runat="server" cssclass="btn btn-default btn-sm" Text="GUARDAR" OnClick="Btn_Guardar_Coordinador_Click" />
                                             <asp:Button ID="btn_Editar_Coordinador" runat="server" CssClass=" btn btn-default btn-sm" Text="EDITAR" OnClick="btn_Editar_Coordinador_Click" />

                                            </div>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                                <!-- /.modal --> 
               </div>
                        <script>
                            $('[data-coordinador]').click(function () {
                                var Id = $(this).data('coordinador');
                                $("#ContentPlaceHolder1_idEliminar").val(Id);
                                //alert(Id);
                            });
                            $('[data-toggle="confirmation"]').confirmation({
                                placement: 'top', // How to position the confirmation - top | bottom | left | right
                                trigger: 'click', // How confirmation is triggered - click | hover | focus | manual
                                title: 'Esta seguro?', // Default title value if `data-title` attribute isn't present  
                                template: '<div class="popover" >' +
                                    '<div class="arrow"></div>' +
                                    '<h3 class="popover-title"></h3>' +
                                    '<div class="popover-content text-center">' +
                                    '<div id="botones" class="btn-group">' +
                                    '<asp:LinkButton ID="BtnEliminar" runat="server" CssClass="btn btn-success btn-xs" OnClick="Delete_Click"><i class="fa fa-check-circle icon-white"></i> Si</asp:LinkButton>' +
                                    '<a class="btn btn-xs" data-dismiss="confirmation"></a>' +
                                    '</div>' +
                                    '</div>'
                                , btnOkClass: 'btn-primary'
                                , btnOkIcon: 'fa fa-check-circle'
                                , btnCancelClass: 'btn-danger'
                                , btnOkLabel: 'Si'
                                , btnCancelIcon: 'fa fa-times-circle'
                                , btnCancelLabel: 'No',
                                singleton: true, // Set true to allow only one confirmation to show at a time.
                                popout: false, // Set true to hide the confirmation when user clicks outside of it.
                                onConfirm: function () {

                                }, // Set event when click at confirm button
                                onCancel: function () { }
                            }); // Set event when click at cancel button
                    </script>
    </form>
</asp:Content>
